package com.example.riskmanage.controller;

import com.example.riskmanage.bean.Riskgaitu;
import com.example.riskmanage.service.RiskgaituManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RiskgaituController {


    @Autowired
    RiskgaituManager riskgaituManager;

    @RequestMapping("/riskgaitu")
    public String riskgaitu(Integer id) {
        String RESPONE = riskgaituManager.getRiskgaituService(id);
        return RESPONE;

    }

    @RequestMapping("/addriskgaitu")
    public String add(@RequestBody Riskgaitu riskgaitu) {
        String flag = riskgaituManager.addRiskgaituService(riskgaitu);
        return flag;
    }

    @RequestMapping("/deleteriskgaitu")
    public String delete(Integer id) {
        String flag = riskgaituManager.deleteAdminService(id);
        return flag;
    }

    @RequestMapping("/risklist")
    public String risk(Integer id){

        String biao=riskgaituManager.getRisklistService(id);
        return biao;
    }

}